Skip to content

fix(server): propagate request cancellation through ADT Server - #160

Merged
ThePlenkov merged 2 commits into
mainfrom
fix/adt-server-request-cancellation
Aug 6, 2026
Merged

fix(server): propagate request cancellation through ADT Server#160
ThePlenkov merged 2 commits into
mainfrom
fix/adt-server-request-cancellation

Conversation

@ThePlenkov

@ThePlenkov ThePlenkov commented Aug 6, 2026

Copy link
Copy Markdown
Member

Goal

Propagate caller cancellation through the generated ADT Server client and the ADT Server REST boundary so disconnected requests stop downstream ADT work.

GitLab shadow review: booking-com/finsys-devops/adt-cli!36

Changes

  • Generated client methods accept an optional request-scoped AbortSignal, including parameterless operations
  • Generated fetch calls forward only the signal supplied for that invocation
  • REST dispatch maps request aborts and premature response closes to the existing request-scoped ADT cancellation context
  • Normal response completion leaves downstream work un-aborted and all listeners are removed
  • Generated output refreshed from the current OpenAPI document

Verification

  • Generated-client consistency check
  • adt-server-client tests: 5 passed
  • adt-server tests: 22 passed
  • adt-server-client build and dependent server builds passed
  • Formatting and diff checks passed

Test plan

  • nx run adt-server-client:test adt-server:test
  • Abort an in-flight ADT Server request and confirm downstream ADT client work stops

Made with Cursor


Summary by cubic

Propagates request cancellation across the generated ADT client and the REST server so disconnected HTTP clients stop downstream ADT work. Refreshes the generated client from the latest OpenAPI and adds per-request AbortSignal support.

  • New Features

    • @abapify/adt-server-client: all methods accept AdtServerRequestOptions with signal to cancel a single call, including parameterless operations; fetch uses only the provided signal.
    • OpenAPI refresh adds getBadi types and client method.
  • Bug Fixes

    • @abapify/adt-server: maps HTTP request aborts and premature response closes to @abapify/adt-client via runWithAdtAbortSignal; normal response completion keeps downstream work active.
    • @abapify/adt-server-client: tests ensure calls forward the caller-provided AbortSignal and fail fast if a signal is omitted.

Written for commit 72d7815. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • New Features

    • Added support for cancelling client requests with an abort signal.
    • Added the getBadi client operation with destination, name, and implementation options.
    • REST requests now stop downstream processing when the connection closes.
  • Bug Fixes

    • Prevented unnecessary downstream requests from continuing after client disconnection.
    • Preserved request cancellation behavior for both parameterized and parameterless calls.

@netlify

netlify Bot commented Aug 6, 2026

Copy link
Copy Markdown

Deploy Preview for adt-cli canceled.

Name Link
🔨 Latest commit 72d7815
🔍 Latest deploy log https://app.netlify.com/projects/adt-cli/deploys/6a74667de3410000084ff5db

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@ThePlenkov, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 42 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: eca31d6d-685a-416d-9bf1-2a2194e4772c

📥 Commits

Reviewing files that changed from the base of the PR and between b6bff2b and 72d7815.

📒 Files selected for processing (1)
  • packages/adt-server-client/tests/client.test.ts
📝 Walkthrough

Walkthrough

The generated ADT client adds getBadi and optional abort-signal request options. REST request handling now propagates client disconnects to downstream ADT requests. Tests cover signal forwarding, normal completion, and cancellation.

Changes

BAdI client operation

Layer / File(s) Summary
BAdI operation contract
packages/adt-server-client/src/generated.ts
The generated client adds getBadi, its path and query parameters, and response types for BAdI metadata and implementations.

Request cancellation propagation

Layer / File(s) Summary
Generated client abort options
packages/adt-server-client/scripts/generate.ts, packages/adt-server-client/src/generated.ts, packages/adt-server-client/tests/client.test.ts
Client methods accept AdtServerRequestOptions and forward its optional AbortSignal to fetch. Tests verify signal identity and abort behavior.
REST request-scoped cancellation
packages/adt-server/src/request-handler.ts, packages/adt-server/tests/server.test.ts
REST handlers propagate request abortion through runWithAdtAbortSignal. Tests cover normal completion and client disconnects.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: propagating request cancellation through the ADT Server boundary.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/adt-server-request-cancellation

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@amazon-q-developer amazon-q-developer Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The implementation correctly propagates caller cancellation through the ADT Server client and REST boundary. The changes properly add optional AbortSignal support to all generated client methods and implement request-scoped cancellation in the server request handler with proper event listener cleanup. All tests pass and verify the expected behavior for both normal completion and abort scenarios.


You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.

@nx-cloud

nx-cloud Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

View your CI Pipeline Execution ↗ for commit b6bff2b

Command Status Duration Result
nx affected -t lint test build e2e-ci --verbose... ✅ Succeeded 8s View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-08-06 10:49:23 UTC

@codacy-production

codacy-production Bot commented Aug 6, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 45 complexity · 7 duplication

Metric Results
Complexity 45
Duplication 7

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@ThePlenkov
ThePlenkov marked this pull request as ready for review August 6, 2026 10:33
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@qodo-code-review

Copy link
Copy Markdown

ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/adt-server-client/tests/client.test.ts`:
- Around line 106-112: Update the fetch mock in the relevant client test so it
immediately rejects when init?.signal is absent, while retaining the existing
abort-listener behavior when a signal is provided. This ensures
signal-forwarding regressions fail promptly instead of leaving the promise
pending.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 108fc015-232d-4a74-aaa8-b8d6aa1863d9

📥 Commits

Reviewing files that changed from the base of the PR and between 90aa2c0 and b6bff2b.

📒 Files selected for processing (5)
  • packages/adt-server-client/scripts/generate.ts
  • packages/adt-server-client/src/generated.ts
  • packages/adt-server-client/tests/client.test.ts
  • packages/adt-server/src/request-handler.ts
  • packages/adt-server/tests/server.test.ts

Comment thread packages/adt-server-client/tests/client.test.ts
@baz-reviewer

baz-reviewer Bot commented Aug 6, 2026

Copy link
Copy Markdown

Merger

Waiting for CI and review to complete.

Commit b6bff2b · Updated 2026-08-06 10:36 UTC


Review this PR on Baz | Customize your next review

@ThePlenkov
ThePlenkov marked this pull request as draft August 6, 2026 10:46
…t signal

Co-Authored-By: Petr Plenkov <petr.plenkov@gmail.com>
@ThePlenkov
ThePlenkov marked this pull request as ready for review August 6, 2026 10:50
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@ThePlenkov
ThePlenkov merged commit b8bde2a into main Aug 6, 2026
15 checks passed
@ThePlenkov
ThePlenkov deleted the fix/adt-server-request-cancellation branch August 6, 2026 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant